package com.mrinalwadhwa.effects.slice
{
	import com.mrinalwadhwa.effects.BendPixels;
	import flash.utils.ByteArray;
	import mx.effects.IEffectInstance;
	
	public class SliceEffect extends BendPixels{

		[Embed("slicer.pbj", mimeType="application/octet-stream")]
		private var SliceFilter:Class;

		public static const MIN_AMOUNT:Number = 0; 
		public static const MAX_AMOUNT:Number = 20; 
		public static const DEFAULT_AMOUNT:Number = 0; 

		public static const MIN_MODUS:Number = 0; 
		public static const MAX_MODUS:Number = 3; 
		public static const DEFAULT_MODUS:Number = 1; 

		public static const MIN_SIZE:Number = 0; 
		public static const MAX_SIZE:Number = 10; 
		public static const DEFAULT_SIZE:Number = 6; 


		[Inspectable(category="General")]
		public var fromAmount:Number = DEFAULT_AMOUNT;
		
		[Inspectable(category="General")]
		public var toAmount:Number = DEFAULT_AMOUNT;

		[Inspectable(category="General")]
		public var fromModus:Number = DEFAULT_MODUS;
		
		[Inspectable(category="General")]
		public var toModus:Number = DEFAULT_MODUS;

		[Inspectable(category="General")]
		public var fromSize:Number = DEFAULT_SIZE;
		
		[Inspectable(category="General")]
		public var toSize:Number = DEFAULT_SIZE;



		public function SliceEffect(target:Object=null){
			super(target);
		}
		
        override protected function initInstance(inst:IEffectInstance):void {
			benderByteArray = new SliceFilter() as ByteArray
			benderParams = [
							['amount',fromAmount,toAmount],
							['modus',fromModus,toModus],
							['size',fromSize,toSize]
						   ];	
            super.initInstance(inst);
        } 		

	}
}